package mylibrary.concurrent;

public class Test {

	int number = 100000000;
	public static void main(String [] args) {
		
		Test test = new Test();
		System.out.println("Start time: " + System.currentTimeMillis());
		long result = test.sum();
		System.out.println("End   time: " + System.currentTimeMillis());
		System.out.println(result);
	}
	
	private long sum() {

		int[] arr = new int[number];
		
		for(int i=0; i<number; i++) {
			arr[i] = i;
		}
		
		long result = 0L;
		for(int i=0; i<arr.length; i++) {
			result += arr[i];
		}	
		return result;
	
	}
}
